<template>
	<view>
		<uv-list>
			<uv-list-item class="css-radius-xl" @click="dumpPage('pages/goods/detail',{id:item.id})" :clickable="true"
				v-for="(item,index) in rows" :key="index">
				<view class="css-flex-x css-justify-between css-padding-sm">
					<view>
						<template v-if="!isEmpty(item.oblong_pic)">
							<image mode="widthFix" :style="[{width:(smBoxWidth/2.3)+'px'}]"
								:src="serverHost+item.oblong_pic">
							</image>
						</template>
						<template v-else>
							<image mode="widthFix" :style="[{width:(smBoxWidth/2)+'px'}]"
								:src="serverHost+'/static/xh/noneOblongPic.png'">
							</image>
						</template>
						<!-- <uv-avatar shape="square" :size="120" :src="serverHost+item.oblong_pic"></uv-avatar> -->
					</view>
					<view class="css-padding-left-sm css-flex-y css-justify-between">
						<view>
							<text class="css-text-bold css-text-lg uv-line-1" v-if="!isEmpty(item.in_name)">{{item.in_name}}</text>
							<text class="css-text-bold css-text-lg uv-line-1" v-if="isEmpty(item.in_name)">{{item.name}}</text>
						</view>
						<view v-if="!isEmpty(item.tishi)">
							<text class="css-text-df css-text-gray uv-line-2">{{item.tishi}}</text>
						</view>
						<view class="css-text-df css-text-gray" style="color: black;font-weight: bold;">
							<text class="" v-if="!isEmpty(item.monthly)">月租:{{item.monthly}}</text>
							<!-- <text class="" v-if="!isEmpty(item.voice)">语音:{{item.voice}}</text> -->
							&nbsp;|&nbsp;
							<text class="" v-if="!isEmpty(item.flow)">流量:{{item.flow}}</text>
						</view>
						<view class="css-text-df css-text-gray" >
							<text class="" style="background-color: #BA692A;margin-right: 5px;padding: 5px; font-size: 10px;" >大流量</text>
							<text class="" style="background-color: #1456FE;margin-right: 5px;padding: 5px; font-size: 10px;">次月返</text>
							<text class="" style="background-color: #F93A4A;margin-right: 5px;padding: 5px; font-size: 10px;">禁发区域</text>
						</view>
						
						<view class="css-flex-x css-align-center css-justify-between">
							<!-- <view class="css-flex-sub">¥0.1元/月</view> -->
							<view class="css-flex-sub"></view>
							<view class="css-flex-twice" >
								<uv-button type="error" shape="circle" border="surround" text="立即办理" color="linear-gradient(to right, #FF600F, #F93A4A)"></uv-button>
							</view>
						</view>
					</view>
				</view>
				<uv-gap height="6" bgColor="#f5f7f9"></uv-gap>
			</uv-list-item>
		</uv-list>
	</view>
</template>

<script>
	export default {
		name: "cu-goods-list",
		props: {
			rows: {
				type: [Array, Object],
				default () {
					return []
				}
			}
		},
		data() {
			return {
				serverHost: '',
				smBoxWidth: uni.$my.boxWidth('css-margin-lr-sm') - (uni.$my.marginLR2px('css-margin-lr-sm') * 2)
			};
		},
		created() {
			this.serverHost = uni.$my.serverHost
			// console.log(uni.$my.marginLR2px('css-margin-lr-sm'))
		},
		methods: {
			isEmpty(item) {
				return uni.$uv.test.empty(item)
			},
			getProperty(obj, key) {
				return uni.$uv.getProperty(obj, key);
			},
			dumpPage(page, params, type) {
				uni.$my.dumpPage(page, params, type)
			},
		}
	}
</script>

<style>

</style>